package iterator;

import java.util.Iterator;
import java.util.List;

/**
 * @Author liangliangzhao
 * @data 2023/4/18 11:12
 */

public class InfoCollegeIterator implements Iterator {
    List<Department> departmentList; // 信息工程学院是以list方法存放系
    int index = -1;// 索引
    public InfoCollegeIterator(List<Department> departmentList) {
        this.departmentList = departmentList;
    }
    public boolean hasNext() {
        if(index >= departmentList.size() - 1){
            return false;
        }else {
            index += 1;
            return true;
        }
    }
    public Object next() {
        return departmentList.get(index);
    }
    public void remove() {}
}
